/*
 * @Author: Zhangxx 2425792130@qq.com
 * @Date: 2024-06-20 10:46:10
 * @LastEditors: restart
 * @LastEditTime: 2024-12-05 14:33:20
 * @FilePath: \eyetrackingManagement-web\vite.config.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path';
// https://vitejs.dev/config/
export default defineConfig({
	plugins: [vue()],
	resolve: {
		alias: {
			// 相对路径别名配置，使用 @ 代替 src
			'@': path.resolve('./src'),
		},
	},
	css: {
		preprocessorOptions: {
			scss: {
				javascriptEnabled: true,
				additionalData: '@import "./src/styles/variable.scss";',
			},
		},
	}, 
	// 配置代理跨域
	server: {
		proxy: {
			'/api': {
				// target:'https://eyetracker-api.66nao.com/api', //上线
        target:'http://10.66.39.142:8090/api', //开发
				// target:'http://localhost:8090/api', //开发
				changeOrigin: true,
				rewrite: (path) => path.replace(/^\/api/, ""),   
			  },
		},
	},
})
